#! /bin/bash

outname="2d-heat"
for exe in $outname
do
    rm ./$exe.txt
    # for i in `seq`;
    # do
    #     export OMP_NUM_THREADS=$i;../$exe/exe-$exe 6000 6000 2000 >> ./$exe.txt 
    #     echo  $i >> ./$outname.cpulist
    # done
    for i in `seq 4 2 100`;
    do
        ../$exe/exe-$exe $i $i 2000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
    for i in `seq 100 10 250`;
    do
        ../$exe/exe-$exe $i $i 2000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
    for i in `seq 300 50 1000`;
    do
        ../$exe/exe-$exe $i $i 2000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
    for i in `seq 2000 1000 6000`;
    do
        ../$exe/exe-$exe $i $i 2000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
done


echo -e "np\tGStencils" > ./$outname.data.txt
cat ./$outname.txt |awk -F "= " '{print $NF}'| paste $outname.cpulist -  | awk '{print $1 "\t" $2 }' >>  ./$outname.data.txt
rm ./$outname.cpulist
rm ./$outname.txt